<?php 
$total = count($adc->getAdCats());
if($total > 1)
{
	$cols = 1;
	if($adc->getSetting('CatListCols') > 0)
	{ $cols = $adc->getSetting('CatListCols'); }
	if($theme->getBootstrap() > 2)
	{ $rowclass = 'row'; }
	else
	{ $rowclass = 'thumbnails'; }
	?>
    <div class="visible-sm visible-phone">
        <button class="btn btn-block btn-info" data-toggle="collapse" data-target=".filter-cats">
            <?php echo ucfirst($txt->getWord(array('display', 'categories'))); ?>
        </button>
    </div>
    <div class="filter-cats placement-filter collapse-phone">
    	<div class="placement-filter-padding">
        	<?php if($rowclass != 'row'):  ?>
            <div class="row-fluid">
            <?php endif; ?>
                <div class="<?php echo $rowclass; ?>">
                    <?php
                    $i = 1;
                    foreach($adc->getAdCats() as $cat)
                    {
                        if(($cat->getAdsCount() > 0) || ($adc->getSetting('ViewEmptyCat') > 0))
                        {
                            $link = $katana->getURL().'/adcat/'.$cat->getId().'/';
                            
                            if($adc->getCurrentAdBrandId() > 0)
                            { $link .= 'adbrand/'.$adc->getCurrentAdBrandId().'/'; }
                            
                            if(intval($_GET['bt']) > 0)
                            { $link .= '?bt='.intval($_GET['bt']); }
                            switch($cols)
                            {
                                case 2: echo '<div class="span6 col-md-6 col-xs-6">'; break;
                                case 3: echo '<div class="span4 col-md-4 col-sm-6 col-xs-6">'; break;
                                case 4: echo '<div class="span3 col-md-3 col-sm-4 col-xs-6">'; break;
                                case 6: echo '<div class="span2 col-md-2 col-sm-4 col-xs-6">'; break;
                                default: echo '<div class="span1 col-md-12">'; break;
                            }
                            if(is_object($cat->getImageObject()))
                            { 
                                ?>
                                <a class="<?php echo $adc->getSetting('CatItemClass'); ?>" href="<?php echo $link; ?>" title="<?php echo $cat->getTitle(); ?>">
                                <img title="<?php echo $cat->getTitle(); ?>" src="<?php echo $cat->getImageObject()->getLink($adc->getSetting('CatListW'), $adc->getSetting('CatListH')) ?>" alt="<?php echo $cat->getTitle(); ?>" />
                                <span><?php echo $txt->truncate($cat->getTitle(), 25, '', '') ?></span><div class="clearfix"></div>
                                </a>
                                <?php
                            }
                            echo '</div>';
                            if(($i%$adc->getSetting('CatListCols')) == 0)
                            { echo '</div></div><div class="row-fluid"><div class="'.$rowclass.'">'; }
                            $class = '';
                            $i++;
                        }
                    }
                    ?>
                </div>
            <?php if($rowclass != 'row'):  ?>
            </div>
            <?php endif; ?>
        </div>
    </div>
    <?php
}
?>